﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InvasionWars
{
    /**
     * want this class to be populated from information pulled from a xml file
     * 
     */
    public class Card
    {
        public string ImageName
        {
            get
            {
                return imageName;
            }
        }
        private string imageName;


        public int Attack { get; set; }
        public int Defense { get; set; }
        public int Speed { get; set; }
        public bool visible { get; set; }

        public Armies Army
        {
            get
            {
                return army;
            }
        }
        private Armies army;

        public string Name {
            get
            {
                return name;
            }
        }
        private string name;

        public string Id
        {
            get
            {
                return id;
            }
        }
        private string id;


        public Card()
        {
            //unset;
        }

        public Card(string pID, string pName, int pAtk, int pDef, int pSpd, string pImgName, Armies pArmy)
        {
            id = pID;
            name = pName;
            Attack = pAtk;
            Defense = pDef;
            Speed = pSpd;
            army = pArmy;
            imageName = pImgName;
           

        }

        public void SetCard(Armies pArmy, string cardID)
        {
            if(cardID.StartsWith("1"))
            {
                pArmy = Armies.HUMAN;
            }
            else
                pArmy = Armies.ALIEN;

            //look up the card in the linked list or table or whatever and then set the variables.
            Card retrievedCard = CardReader.GetCardByID(pArmy, cardID);
            this.id = retrievedCard.Id;
            this.imageName = retrievedCard.ImageName;
            this.name = retrievedCard.Name;
            this.Speed = retrievedCard.Speed;
            this.Attack = retrievedCard.Attack;
            this.Defense = retrievedCard.Defense;
            this.army = pArmy;
            

        }
    }
}
